package edu.biwu.sms;

import edu.biwu.constant.EnrollmentStatus;

import java.time.LocalDate;

public class MiddleStudent extends Student implements EveningStudy {
    //历史成绩
    private Integer historyScore;
    //物理成绩
    private Integer physicsScore;

    public MiddleStudent(Integer studentid, String name, Integer chineseScore, Integer mathScore, LocalDate enrollmentDate, String emall, EnrollmentStatus enrollmentStatus, Integer historyScore, Integer physicsScore) {
        super(studentid, name, chineseScore, mathScore, enrollmentDate, emall, enrollmentStatus);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(Integer studentid, String name, Integer chineseScore, Integer mathScore, LocalDate enrollmentDate, String emall, Integer historyScore, Integer physicsScore) {
        super(studentid, name, chineseScore, mathScore, enrollmentDate, emall);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(Integer studentid, String name, Integer chineseScore, Integer mathScore, LocalDate enrollmentDate, Integer historyScore, Integer physicsScore) {
        super(studentid, name, chineseScore, mathScore, enrollmentDate);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(Integer studentid, String name, Integer chineseScore, Integer mathScore, Integer historyScore, Integer physicsScore) {
        super(studentid, name, chineseScore, mathScore);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }



    public Integer getHistoryScore() {
        return historyScore;
    }

    public void setHistoryScore(Integer historyScore) {
        this.historyScore = historyScore;
    }

    public Integer getPhysicsScore() {
        return physicsScore;
    }

    public void setPhysicsScore(Integer physicsScore) {
        this.physicsScore = physicsScore;
    }

    /*重写上晚自习方法*/

    @Override
    public void eveningStudy() {
        System.out.println("中学生"+getName()+"正在上晚自习...");
    }

    /*中学生的总成绩*/
    public Integer getTotalScore() {
        return super.getTotalScore()+historyScore+physicsScore;
    }

    /*中学生信息展示*/
    @Override
    public String toString(){
        return getStudentid()+" "+getName()+" "+getChineseScore()+" "+
                getMathScore()+" "+getHistoryScore()+" "+getPhysicsScore()+" "
                +getEmall()+" "+getEnrollmentDate()+" "+getTotalScore()+" "+getAvatar()+
                " "+getEnrollmentStatus();
    }



}
